﻿//--------------------------------------------------------------------------
// 
//  Copyright (c) Chili Software.  All rights reserved. 
// 
//  File: InvalidTypeException.cs
//
//  Description: Exception for an invalid storage type.
// 
//--------------------------------------------------------------------------

using System;

namespace Chili.Opf3
{
	/// <summary>
	/// Exception is thrown if a type in the storage is not supported by framework.
	/// </summary>
	/// <remarks>
	/// This exception is thrown if a type is not recognized by the framework. If you try
	/// to save a type that can't be saved directly to the storage you get this exception. To
	/// avoid this kind of exception try to implement the
	/// <see cref="IUserDefinedType">IUserDefinedType</see> interface.
	/// </remarks>
	[Serializable]
	public sealed class InvalidTypeException : Exception
	{
		/// <summary>
		/// Creates a new instance of the
		/// <see cref="InvalidTypeException">InvalidTypeException Class</see>.
		/// </summary>
		private InvalidTypeException(System.Runtime.Serialization.SerializationInfo info,
		  System.Runtime.Serialization.StreamingContext context) : base(info, context)
		{
		}

		/// <summary>
		/// Creates a new instance of the
		/// <see cref="InvalidTypeException">InvalidTypeException Class</see>.
		/// </summary>
		public InvalidTypeException()
		{
		}

		/// <summary>
		/// Creates a new instance of the
		/// <see cref="InvalidTypeException">InvalidTypeException Class</see>.
		/// </summary>
		/// <param name="message">A message that describes the current exception.</param>
		public InvalidTypeException(string message) : base(message)
		{
		}

		/// <summary>
		/// Creates a new instance of the
		/// <see cref="InvalidTypeException">InvalidTypeException Class</see>.
		/// </summary>
		/// <param name="message">A message that describes the current exception.</param>
		/// <param name="inner">The exception that caused the current exception.</param>
		public InvalidTypeException(string message, Exception inner) : base(message, inner)
		{
		}
	}
}
